<%@page import="com.shsh.safemanage.model.AccidentRegisterForm"%>
<%@page language="java" pageEncoding="UTF-8"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.util.RequestUtil"%>
<%@page import="com.shsh.safemanage.util.Util"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="com.shsh.safemanage.model.ProblemTransfer"%>
<%@page import="com.shsh.safemanage.model.AbstractAccident"%>
<%@page import="com.shsh.safemanage.model.ProblemTransferFeedback"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.AccidentDao"%>
<%@page import="com.shsh.safemanage.dao.ProblemDao"%>
<%@page import="com.shsh.safemanage.dao.UserDao"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%@page import="com.shsh.safemanage.action.UserAction"%>
<%@page import="com.shsh.safemanage.action.WriteProblemAction"%>
<%
{
Long problemID = RequestUtil.getParameter(request, Constants.REQUEST_PARAMETER_ID, (Long)null);
if(problemID==null){
	return;
}
AccidentDao accidentDao = DaoCreator.createAccidentDao();
ProblemDao problemDao = DaoCreator.createProblemDao();
UserDao userDao = DaoCreator.createUserDao();

WriteProblemAction writeProblemAction = ActionCreator.createWriteProblemAction();
UserAction userAction = ActionCreator.createUserAction();

AbstractAccident accident = accidentDao.getCheckFormByID(3, problemID);

int[] accidentTime = Util.getDate(accident.getAccidentTime());

User user = userDao.getUserByID(accident.getAccidentWriteUserID());

List<ProblemTransferFeedback> feedbackList = problemDao.getProblemTransferFeedbackByProblemID(problemID);
ProblemTransfer currentTransfer = problemDao.getProblemTransfer(accident.getWriteUserID(), problemID, user.getId());
String fromPage = request.getParameter(Constants.REQUEST_PARAMETER_FROM_PAGE);
%>
<div class="hider" id="hider">
	<span>&nbsp;</span>
</div>
<div class="position">
	<img src="images/position2.jpg" style="padding: 7px 9px; float: left;" />当前位置：上海高桥分公司问题管理平台 &gt;&gt; 浏览事故“四不放过”检查表（3）
</div>
<div class="tt">《事故“四不放过”检查表》（3）</div>
<div class="content">
	<font style="float:right;margin-right:20px;margin-bottom:5px;font-size:15;">SHGQ0-JL-AH-26-00-01-2010</font>
	<table align="center" border="1" width="99%" cellpadding="0"
		cellspacing="0">
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: bold">流程跟踪：</span>
			<br />
			<span style="margin-left: 50px; color: red">
			<%=Util.formatDateTime(accident.getWriteTime())%> <%=accident.getWriteUserName()%> 填报问题
			</span>
			<%
			for (ProblemTransferFeedback feedback : feedbackList) {
			%>
			<br />
			<span style="margin-left: 50px; color: red">
			<%=Util.formatDateTime(feedback.getFeedbackTime())%>
			<%
			User theFeedbackUser = userDao.getUserByID(feedback.getUserID());
			%>
			<%=theFeedbackUser.getName()%>
			<%=feedback.getProcessMethod() == Constants.PROCESS_METHOD_CLOSE? "确认同意":feedback.getProcessMethodStr()%>
			</span>
			<%
			}
			%>
		</td>
	</tr>
		<tr>
			<td class="td1" colspan="3" height="35" id="chooseDepartEquipTD">
				<span style="margin-left: 30px; font-weight: bold">作业部（业务中心）：</span> <span><%=accident.getDepartment1Name()%></span>
				<span style="margin-left: 30px; font-weight: bold">装置：</span> <span><%=accident.getEquipmentName()%></span>
				<span style="margin-left: 20px" class="span1">事故类型：</span><span><%=accident.getAccidentType()%></span>
			</td>
		</tr>
		<tr>
			<td class="td1" width="60%">			
				<span style="margin-left: 30px; font-weight: ">事故名称：</span>  <br/>
				<span style="margin-left: 30px;">
						<textarea readonly="readonly" rows="3" style="width:90%; margin-bottom:5px;" id="accidentName"><%=Util.getDisplay(accident.getAccidentName(), "")%></textarea>	
				</span>	
			</td>
			<td  class="td1" width="40%" colspan="2">
				<span style="margin-left: 30px; font-weight: ">事故发生时间：</span>	
				<span style="margin-left: 0px; ">						
						<input style="margin-left: 5px; width:35px;" readonly="readonly" type="text" value="<%=accidentTime[0] %>"/>年	
						<input style="margin-left: 5px; width:25px;" readonly="readonly" type="text" value="<%=accidentTime[1] %>"/>月	
						<input style="margin-left: 5px; width:25px;" readonly="readonly" type="text" value="<%=accidentTime[2] %>"/>日
						<input style="margin-left: 5px; width:25px;" readonly="readonly" type="text" value="<%=accidentTime[3] %>"/>时
						<input style="margin-left: 5px; width:25px;" readonly="readonly" type="text" value="<%=accidentTime[4] %>"/>分
				</span>	
			</td>
		</tr>
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: ">人员伤亡情况：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="10" style="width:90%; margin-bottom:5px;" id="casualty"><%=Util.getDisplay(accident.getCasualty(), "")  %></textarea>	
			</span>
		</td>
		</tr>
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: ">直接经济损失和间接损失：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="10" style="width:90%; margin-bottom:5px;" id="loss"><%=Util.getDisplay(accident.getLoss(), "") %></textarea>	
			</span>
		</td>
		</tr>
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: ">事故原因：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="10" style="width:90%; margin-bottom:5px;" id="reason"><%=Util.getDisplay(accident.getReason(), "") %></textarea>	
			</span>
		</td>
		</tr>
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: ">事故教训及防范措施：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="10" style="width:90%; margin-bottom:5px;" id="moral"><%=Util.getDisplay(accident.getMoral(), "") %></textarea>	
			</span>
		</td>
		</tr>
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: ">事故责任分析及处理情况：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="10" style="width:90%; margin-bottom:5px;" id="duty"><%=Util.getDisplay(accident.getDuty(), "")%></textarea>	
			</span>
		</td>
		</tr>		
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: ">教育与反思：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="10" style="width:90%; margin-bottom:5px;" id="introspection"><%=Util.getDisplay(accident.getIntrospection(), "")%></textarea>	
			</span>
		</td>
		</tr>
		<tr>
		<td class="td1" colspan="3">
			<span style="margin-left: 30px; font-weight: ">复查情况：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="10" style="width:90%; margin-bottom:5px;" id="reviewDetail"><%=Util.getDisplay(accident.getReviewDetail(), "")%></textarea>	
			</span>
		</td>
		</tr>
		<tr>
		<td class="td1" colspan="2">
			<span style="margin-left: 30px; font-weight: ">复查人员：
			</span> 
			<br/>
			<span style="margin-left: 30px; ">
				<textarea readonly="readonly" rows="3" style="width:90%; margin-bottom:5px;" id="reviewTeam"><%=Util.getDisplay(accident.getReviewTeam(), "")%></textarea>	
			</span>
		</td>
		<td class="td1">
			<span style="margin-left: 30px; font-weight: ">复查日期：
			</span> 
			<span><%=Util.formatDate(accident.getReviewTime())%></span>
		</td>
		</tr>
		<tr>
			<td class="td1" colspan="3">
				<span style="margin-left: 30px" class="span1">填报人及时间：</span>
				<span><%=user.getDepartment1Name()%>-<%=user.getDepartment2Name()%>-<%=user.getDepartment3Name()%></span>
				<span><%=user.getName()%></span>
				<span><%=Util.formatDateTime(accident.getAccidentWriteTime())%></span>
			</td>
		</tr>
		<tr>
			<td class="td1" align="center" colspan="3">
				<input type="button" value="取 消" style="margin-left: 20px" onclick="cancelFeedback()" />
			</td>
		</tr>
	</table>
</div>
<script type="text/javascript">
function cancelFeedback(){
	loadPageSection(
			'<%=request.getContextPath()%>/<%=fromPage%>', 
			'mainContentDiv', 
			{
				id: <%=problemID%>
			}, 
			true
		);	
}

</script>
<%
}
%>